import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/equip_instrument_entity.dart';
import 'package:get/get.dart';

class InterlockListController extends GetxController {
  Future<List<EquipInstrumentEntity>> getListData(int pageNum, int pageSize, {String? search}) async {
    // 获取列表接口
    final res = await HttpUtil().generateGetRequest<List<EquipInstrumentEntity>>(
      Interface.getInstrumentPage,
      queryParameters: {
        'pageNum': pageNum,
        'pageSize': pageSize,
        'name': search,
      },
    ).execute();
    List<EquipInstrumentEntity>? data;
    res.onSuccess((result) {
      if (result.data != null) {
        data = result.data!;
      }
    });
    return data ?? [];
  }
}
